package com.theeviljames.lexer;

public class Token {

	public static final byte MULT = 0,DIV = 1,ADD=2,SUB=3,POW=4,
		LPAREN=5,RPAREN=6,IDENTIFIER=7,CONSTANT=8,EOF=9,NONTERMINAL=10;
	
	
	private byte type;
	private String literal;
	
	public Token(String literal, byte type) {
		this.literal = literal;
		this.type = type;
	}

	public String getLiteral() {
		return literal;
	}

	public void setLiteral(String literal) {
		this.literal = literal;
	}

	public byte getType() {
		return type;
	}

	public void setType(byte type) {
		this.type = type;
	}
	
	@Override
	public boolean equals(Object obj) {
		Token other = (Token)obj;
		return other.literal.equals(this.literal)&&other.type==this.type;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Literal> " + literal + " Type> " + type;
	}
	
}
